﻿/************************************************
*
* Copyright(c) ZeeGuo.com
*
* CLR : 4.0.30319.296
*
* FileName : EntityComicList.cs
*
* Author : Kurodo
*
* CreatTime : 2013/6/27 12:20:27
*           
*************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ComicSpider;

namespace ComicSpider.Model
{
    public abstract class EntityComicBook : Entity
    {
        public String Comic_BookName
        {
            get;
            set;
        }

        public String Comic_ChapterName
        {
            get;
            protected set;
        }

        public Int32 Comic_PageCount
        {
            get;
            protected set;
        }

        protected virtual String GetBookName(string context)
        {
            return string.Empty;
        }

        protected virtual String GetChapterName(string context)
        {
            return string.Empty;
        }

        protected virtual Int32 GetPageCount(string context)
        {
            return 0;
        }

        public List<string> Comic_Pages
        {
            get;
            protected set;
        }

        public abstract List<string> GenerateComicPages(string context);

        public override void EntityBuild(string context)
        {
            if(this.Comic_BookName == string.Empty)
                this.GetBookName(context);

            this.Comic_ChapterName = this.GetChapterName(context);
            this.Comic_PageCount = this.GetPageCount(context);
        }
    }
}
